package com.sg.fileService.common;  
/**  
 * ClassName:FileUploadException <br/>  
 * Function: 文件上传异常 <br/>  
 * Reason:   文件上传工具通用抛出异常 <br/>  
 * Date:     2018年1月2日 下午1:23:11 <br/>  
 * @author   Lwt  
 * @version    
 * @since    JDK 1.8  
 * @see        
 */
public class FileUploadException extends Exception {

		
	private static final long serialVersionUID = -7949366640382931537L;
	
	/**
	 * 
		 * Creates a new instance of FileUploadException.  
		 *  
		 * @param errorCode 异常码
		 * @param errorMessage 异常信息
		 * @param e 捕获异常
	 */
	public FileUploadException(ErrorCode errorCode, Exception e) {
		this.errorCode = errorCode.getErrorCodeValue();
		this.errorMessage = errorCode.getCodeMessage();
		if (e != null) {
			this.setStackTrace(e.getStackTrace());
		}
	}
	
	/**
	 * 
		 * Creates a new instance of FileUploadException.  
		 *  
		 * @param errorCode 异常码
		 * @param errorMessage 异常信息
		 * @param e 捕获异常
	 */
	public FileUploadException(ErrorCode errorCode) {
		this.errorCode = errorCode.getErrorCodeValue();
		this.errorMessage = errorCode.getCodeMessage();
	}
	
	/**
	 * 异常码
	 */
	private final String errorCode;
	
	/**
	 * 异常信息
	 */
	private final String errorMessage;

	public String getErrorCode() {
	
		return errorCode;
	}

	public String getErrorMessage() {
	
		return errorMessage;
	}
}
  
	